import {request} from "../request";

export function addInterviewArrange(interviewArrange){
	return request({
		url: '/per/interview-arrange',
		method: 'post',
		data: interviewArrange
	})
}

export function getInterviewArrangePageInfo({hr,position,interCycle,pageSize,pageNum}){
	console.log("查询选项",interCycle)
	return request({
		url: '/per/interview-arrange/page-info',
		method: 'get',
		params:{
			hr,
			position,
			interCycle,
			pageNum,
			pageSize
		}
	})
}

//获取面试人员
export function getHrOptions(){
	return request({
		url: '/per/interview-arrange/hr-options',
		method: 'get'
	})
}

//获取面试岗位选项
export function getPositionOptions(){
	return request({
		url: '/per/interview-arrange/position-options',
		method: 'get'
	})
}

// 发送面试通知
export function sendEmailByReuse(arrEmail){
	console.log("interviewJsSendEmail ->",arrEmail)
	let arr1 = [];

	for (let arr of arrEmail) {
		let ss = {}
		ss.id = arr.id;
		ss.formName = arr.formName;
		ss.interviewDate = arr.interviewDate;
		ss.interviewTime = arr.interviewTime;
		ss.phaseName = arr.phaseName;
		ss.position = arr.position;
		ss.resume = arr.resume
		arr1.push(ss)
	}

	console.log("arr",arr1)
	return request({
		url:'/per/interview-arrange/send-e',
		method:'post',
		data:arr1
	})
}

//添加面试结果
export function updateInterviewArrange(interviewArrange){
	console.log('aaa',interviewArrange)
	return request({
		url: '/per/interview-arrange',
		method: 'put',
		data: interviewArrange
	})
}